Skip to content

Latest commit

 

History

History
301 lines (236 loc) · 14.1 KB

OrderService.md

File metadata and controls

301 lines (236 loc) · 14.1 KB

OrderService

A list of all methods in the OrderService service. Click on the method name to view detailed information about that method.

Methods Description
list_order Retrieve a list of all orders.
create_order Create an order for goods. For services, see Create Subscription.
retrieve_order Retrieve the details of an order.
update_order Change or modify an order.
pay_order Pay an order.

list_order

Retrieve a list of all orders.

  • HTTP Method: GET
  • Endpoint: /v1/orders

Parameters

Name Type Required Description
access_key str Unique access key provided by Rapyd for each authorized user.
content_type str Indicates that the data appears in JSON format. Set to application/json.
salt str Random string. Recommended length: 8-16 characters.
signature str Signature calculated for each request individually. See Request Signatures.
timestamp str Timestamp for the request, in Unix time (seconds).
limit str The maximum number of orders to return. Range - 1-100. Default is 10.
ending_before str The ID of the order created after the last order you want to retrieve.
starting_after str The ID of the order created before the first order you want to retrieve.
idempotency str A unique key that prevents the platform from creating the same object twice.

Return Type

InlineResponse200_46

Example Usage Code Snippet

from rapyd_sdk import RapydSdk, Environment

sdk = RapydSdk(
    base_url=Environment.DEFAULT.value,
    timeout=10000
)

result = sdk.order.list_order(
    access_key="access_key",
    content_type="Content-Type",
    salt="salt",
    signature="signature",
    timestamp="timestamp",
    limit="limit",
    ending_before="ending_before",
    starting_after="starting_after",
    idempotency="idempotency"
)

print(result)

create_order

Create an order for goods. For services, see Create Subscription.

  • HTTP Method: POST
  • Endpoint: /v1/orders

Parameters

Name Type Required Description
request_body V1OrdersBody The request body.
access_key str Unique access key provided by Rapyd for each authorized user.
content_type str Indicates that the data appears in JSON format. Set to application/json.
salt str Random string. Recommended length: 8-16 characters.
signature str Signature calculated for each request individually. See Request Signatures.
timestamp str Timestamp for the request, in Unix time (seconds).
idempotency str A unique key that prevents the platform from creating the same object twice.

Return Type

InlineResponse200_47

Example Usage Code Snippet

from rapyd_sdk import RapydSdk, Environment
from rapyd_sdk.models import V1OrdersBody

sdk = RapydSdk(
    base_url=Environment.DEFAULT.value,
    timeout=10000
)

request_body = V1OrdersBody(
    coupon="coupon",
    customer="customer",
    currency="currency",
    email="email",
    items=[
        {
            "amount": "amount",
            "currency": "GBP",
            "description": "description",
            "parent": "parent",
            "type_": "shipping",
            "quantity": 4.16
        }
    ],
    metadata={},
    shipping_address={
        "canton": "canton",
        "city": "city",
        "country": "GB",
        "created_at": 0.93,
        "district": "district",
        "id_": "id",
        "line_1": "line_1",
        "line_2": "line_2",
        "line_3": "line_3",
        "metadata": {},
        "name": "name",
        "phone_number": "phone_number",
        "state": "state",
        "zip": "zip"
    },
    tax_percent=3.75,
    upstream_id="upstream_id"
)

result = sdk.order.create_order(
    request_body=request_body,
    access_key="access_key",
    content_type="Content-Type",
    salt="salt",
    signature="signature",
    timestamp="timestamp",
    idempotency="idempotency"
)

print(result)

retrieve_order

Retrieve the details of an order.

  • HTTP Method: GET
  • Endpoint: /v1/orders/{orderId}

Parameters

Name Type Required Description
order_id str ID of the order. String starting with order_.
access_key str Unique access key provided by Rapyd for each authorized user.
content_type str Indicates that the data appears in JSON format. Set to application/json.
salt str Random string. Recommended length: 8-16 characters.
signature str Signature calculated for each request individually. See Request Signatures.
timestamp str Timestamp for the request, in Unix time (seconds).
idempotency str A unique key that prevents the platform from creating the same object twice.

Return Type

InlineResponse200_47

Example Usage Code Snippet

from rapyd_sdk import RapydSdk, Environment

sdk = RapydSdk(
    base_url=Environment.DEFAULT.value,
    timeout=10000
)

result = sdk.order.retrieve_order(
    order_id="orderId",
    access_key="access_key",
    content_type="Content-Type",
    salt="salt",
    signature="signature",
    timestamp="timestamp",
    idempotency="idempotency"
)

print(result)

update_order

Change or modify an order.

  • HTTP Method: POST
  • Endpoint: /v1/orders/{orderId}

Parameters

Name Type Required Description
request_body OrdersOrderIdBody The request body.
order_id str ID of the order. String starting with order_.
access_key str Unique access key provided by Rapyd for each authorized user.
content_type str Indicates that the data appears in JSON format. Set to application/json.
salt str Random string. Recommended length: 8-16 characters.
signature str Signature calculated for each request individually. See Request Signatures.
timestamp str Timestamp for the request, in Unix time (seconds).
idempotency str A unique key that prevents the platform from creating the same object twice.

Return Type

InlineResponse200_47

Example Usage Code Snippet

from rapyd_sdk import RapydSdk, Environment
from rapyd_sdk.models import OrdersOrderIdBody

sdk = RapydSdk(
    base_url=Environment.DEFAULT.value,
    timeout=10000
)

request_body = OrdersOrderIdBody(
    coupon="coupon",
    metadata={},
    tax_percent=9.41,
    status="paid"
)

result = sdk.order.update_order(
    request_body=request_body,
    order_id="orderId",
    access_key="access_key",
    content_type="Content-Type",
    salt="salt",
    signature="signature",
    timestamp="timestamp",
    idempotency="idempotency"
)

print(result)

pay_order

Pay an order.

  • HTTP Method: POST
  • Endpoint: /v1/orders/{orderId}/pay

Parameters

Name Type Required Description
request_body OrderIdPayBody The request body.
order_id str ID of the order. String starting with order_.
access_key str Unique access key provided by Rapyd for each authorized user.
content_type str Indicates that the data appears in JSON format. Set to application/json.
salt str Random string. Recommended length: 8-16 characters.
signature str Signature calculated for each request individually. See Request Signatures.
timestamp str Timestamp for the request, in Unix time (seconds).
idempotency str A unique key that prevents the platform from creating the same object twice.

Return Type

InlineResponse200_47

Example Usage Code Snippet

from rapyd_sdk import RapydSdk, Environment
from rapyd_sdk.models import OrderIdPayBody

sdk = RapydSdk(
    base_url=Environment.DEFAULT.value,
    timeout=10000
)

request_body = OrderIdPayBody(
    metadata={},
    payment_method="payment_method",
    customer="customer"
)

result = sdk.order.pay_order(
    request_body=request_body,
    order_id="orderId",
    access_key="access_key",
    content_type="Content-Type",
    salt="salt",
    signature="signature",
    timestamp="timestamp",
    idempotency="idempotency"
)

print(result)