Executes a purchase.
A purchase can be completed both with and without authentication. Purchases that use a pre-created payment instrument must use authentication.
To preview the purchase before completing it, use the Purchase preview operation.
websiteId required | string <= 50 characters ID of the website. A website is where an organization obtains a customer. For more information, see Obtain an organization ID and website ID. | ||||||||||||||||||||||||||||||
required | Payment token (object) or Payment instrument (object) or Payment Methods (object) or Payment card (object) or Bank account (object) Payment instruction for the purchase. | ||||||||||||||||||||||||||||||
required | Array of objects non-empty | ||||||||||||||||||||||||||||||
object or null Billing address details. | |||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||
object or null Delivery address details. | |||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||
shippingRateId | string <= 50 characters ID of the shipping rate. If this value is not set, the cheapest applicable shipping rate is chosen. | ||||||||||||||||||||||||||||||
couponIds | Array of strings List of coupons that are applied to the order. | ||||||||||||||||||||||||||||||
password | string or null Customer account password. If this value is set, it is used to create a customer account. | ||||||||||||||||||||||||||||||
redirectUrl | string or null <uri> URL to redirect the end-user when an offsite transaction is completed.
If
This field defaults to the configured website URL.
You may use |
Order created.
Location | string <uri> Location of the related resource. Example: "https://api.rebilly.com/example" |
orderId | string <= 50 characters ID of the order. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
object (StorefrontInvoice) Initial invoice. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
object (StorefrontTransaction) Initial transaction. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
token | string Session token that is used for authentication. This token can be used to view the created order, invoice, and transaction. |
Unauthorized access. Invalid credentials used.
Access forbidden.
Invalid data sent.
{- "websiteId": "web_0YV7DE4Z26DQSA1AC92FBJ7SEG",
- "items": [
- {
- "planId": "plan_0YV7DENSVGDBW9S71XZNNYYQ0X",
- "quantity": 0
}
], - "billingAddress": {
- "firstName": "Benjamin",
- "lastName": "Franklin",
- "organization": "Rebilly",
- "address": "36 Craven St",
- "address2": "string",
- "city": "Austin",
- "region": "Texas",
- "country": "GB",
- "postalCode": "WC2N 5NF",
- "phoneNumbers": [
- {
- "label": "main",
- "value": "512-710-1640",
- "primary": true
}
], - "emails": [
- {
- "label": "main",
- "value": "rebilly@example.com",
- "primary": true
}
], - "dob": "1980-04-01",
- "jobTitle": "CEO"
}, - "deliveryAddress": {
- "firstName": "Benjamin",
- "lastName": "Franklin",
- "organization": "Rebilly",
- "address": "36 Craven St",
- "address2": "string",
- "city": "Austin",
- "region": "Texas",
- "country": "GB",
- "postalCode": "WC2N 5NF",
- "phoneNumbers": [
- {
- "label": "main",
- "value": "512-710-1640",
- "primary": true
}
], - "emails": [
- {
- "label": "main",
- "value": "rebilly@example.com",
- "primary": true
}
], - "dob": "1980-04-01",
- "jobTitle": "CEO"
}, - "shippingRateId": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
- "paymentInstruction": {
- "token": "string"
}, - "couponIds": [
- "string"
], - "password": "string",
}
{- "orderId": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
- "invoice": {
- "id": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
- "websiteId": "web_0YV7DE4Z26DQSA1AC92FBJ7SEG",
- "invoiceNumber": 0,
- "subscriptionId": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
- "currency": "USD",
- "amount": 0,
- "amountDue": 0,
- "subtotalAmount": 0,
- "discountAmount": 0,
- "shipping": {
- "amount": 0,
- "calculator": "manual"
}, - "tax": {
- "amount": 0,
- "calculator": "string",
- "items": [
- {
- "amount": 0,
- "description": "string",
- "rate": 0,
- "stateAmount": 0.94,
- "countyAmount": 0.04,
- "cityAmount": 0,
- "specialDistrictAmount": 0.38,
- "stateRate": 0,
- "countyRate": 0,
- "cityRate": 0,
- "specialDistrictRate": 0,
- "jurisdictions": {
- "country": "US",
- "state": "CA",
- "county": "LOS ANGELES",
- "city": "LOS ANGELES"
}
}
]
}, - "billingAddress": {
- "firstName": "Benjamin",
- "lastName": "Franklin",
- "organization": "Rebilly",
- "address": "36 Craven St",
- "address2": "string",
- "city": "Austin",
- "region": "Texas",
- "country": "GB",
- "postalCode": "WC2N 5NF",
- "phoneNumbers": [
- {
- "label": "main",
- "value": "512-710-1640",
- "primary": true
}
], - "emails": [
- {
- "label": "main",
- "value": "rebilly@example.com",
- "primary": true
}
], - "dob": "1980-04-01",
- "jobTitle": "CEO",
- "hash": "056ae6d97c788b9e98b049ebafd7b229bf852221"
}, - "deliveryAddress": {
- "firstName": "Benjamin",
- "lastName": "Franklin",
- "organization": "Rebilly",
- "address": "36 Craven St",
- "address2": "string",
- "city": "Austin",
- "region": "Texas",
- "country": "GB",
- "postalCode": "WC2N 5NF",
- "phoneNumbers": [
- {
- "label": "main",
- "value": "512-710-1640",
- "primary": true
}
], - "emails": [
- {
- "label": "main",
- "value": "rebilly@example.com",
- "primary": true
}
], - "dob": "1980-04-01",
- "jobTitle": "CEO",
- "hash": "056ae6d97c788b9e98b049ebafd7b229bf852221"
}, - "poNumber": "PO123456",
- "notes": "string",
- "items": [
- {
- "id": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
- "type": "debit",
- "description": "string",
- "unitPrice": 0,
- "quantity": 0,
- "price": 0,
- "productId": "prod_0YV7DES3WPC5J8JD8QTVNZBZNZ",
- "discountAmount": 0,
- "periodStartTime": "2019-08-24T14:15:22Z",
- "periodEndTime": "2019-08-24T14:15:22Z",
- "periodNumber": 0,
- "createdTime": "2019-08-24T14:15:22Z",
- "updatedTime": "2019-08-24T14:15:22Z",
- "tax": {
- "amount": 0,
- "description": "string",
- "rate": 0,
- "stateAmount": 0.94,
- "countyAmount": 0.04,
- "cityAmount": 0,
- "specialDistrictAmount": 0.38,
- "stateRate": 0,
- "countyRate": 0,
- "cityRate": 0,
- "specialDistrictRate": 0,
- "jurisdictions": {
- "country": "US",
- "state": "CA",
- "county": "LOS ANGELES",
- "city": "LOS ANGELES"
}
}, - "_links": [
- {
- "href": "string",
- "rel": "self"
}
], - "_embedded": {
- "product": { },
- "plan": { }
}
}
], - "discounts": [
- {
- "couponId": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
- "redemptionId": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
- "amount": 0,
- "description": "string",
- "context": "items"
}
], - "autopayScheduledTime": "2019-08-24T14:15:22Z",
- "autopayRetryNumber": 0,
- "status": "draft",
- "delinquentCollectionPeriod": 0,
- "collectionPeriod": 0,
- "abandonedTime": "2019-08-24T14:15:22Z",
- "voidedTime": "2019-08-24T14:15:22Z",
- "paidTime": "2019-08-24T14:15:22Z",
- "dueTime": "2019-08-24T14:15:22Z",
- "issuedTime": "2019-08-24T14:15:22Z",
- "createdTime": "2019-08-24T14:15:22Z",
- "updatedTime": "2019-08-24T14:15:22Z",
- "paymentFormUrl": "string",
- "transactions": [
- {
- "id": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
- "websiteId": "web_0YV7DE4Z26DQSA1AC92FBJ7SEG",
- "customerId": "cus_0YV7DDSDD1C8DA64KHH2W33CPF",
- "type": "3ds-authentication",
- "status": "completed",
- "result": "abandoned",
- "amount": 0,
- "currency": "USD",
- "purchaseAmount": 0,
- "purchaseCurrency": "USD",
- "requestAmount": 0,
- "requestCurrency": "USD",
- "parentTransactionId": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
- "childTransactions": [
- "4f6cf35x-2c4y-483z-a0a9-158621f77a21"
], - "invoiceIds": [
- "4f6cf35x-2c4y-483z-a0a9-158621f77a21"
], - "subscriptionIds": [
- "4f6cf35x-2c4y-483z-a0a9-158621f77a21"
], - "planIds": [
- "4f6cf35x-2c4y-483z-a0a9-158621f77a21"
], - "isRebill": true,
- "rebillNumber": 0,
- "billingAddress": {
- "firstName": "Benjamin",
- "lastName": "Franklin",
- "organization": "Rebilly",
- "address": "36 Craven St",
- "address2": "string",
- "city": "Austin",
- "region": "Texas",
- "country": "GB",
- "postalCode": "WC2N 5NF",
- "phoneNumbers": [
- {
- "label": "main",
- "value": "512-710-1640",
- "primary": true
}
], - "emails": [
- {
- "label": "main",
- "value": "rebilly@example.com",
- "primary": true
}
], - "dob": "1980-04-01",
- "jobTitle": "CEO",
- "hash": "056ae6d97c788b9e98b049ebafd7b229bf852221"
}, - "has3ds": true,
- "3ds": {
- "server": "string",
- "version": "1.0.2",
- "enrolled": "yes",
- "authenticated": "yes",
- "liability": "protected",
- "flow": "frictionless",
- "isDowngraded": false
}, - "retryNumber": 0,
- "isRetry": true,
- "billingDescriptor": "string",
- "description": "string",
- "requestId": "string",
- "hasAmountAdjustment": true,
- "gatewayName": "A1Gateway",
- "customFields": {
- "foo": "bar"
}, - "processedTime": "2019-08-24T14:15:22Z",
- "createdTime": "2019-08-24T14:15:22Z",
- "updatedTime": "2019-08-24T14:15:22Z",
- "paymentInstrument": {
- "method": "payment-card",
- "paymentInstrumentId": "4f6cf35x-2c4y-483z-a0a9-158621f77a21"
}, - "token": "string",
- "_links": [
- {
- "href": "string",
- "rel": "self"
}
]
}
], - "_links": [
- {
- "href": "string",
- "rel": "self"
}
]
}, - "transaction": {
- "id": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
- "websiteId": "web_0YV7DE4Z26DQSA1AC92FBJ7SEG",
- "customerId": "cus_0YV7DDSDD1C8DA64KHH2W33CPF",
- "type": "3ds-authentication",
- "status": "completed",
- "result": "abandoned",
- "amount": 0,
- "currency": "USD",
- "purchaseAmount": 0,
- "purchaseCurrency": "USD",
- "requestAmount": 0,
- "requestCurrency": "USD",
- "parentTransactionId": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
- "childTransactions": [
- "4f6cf35x-2c4y-483z-a0a9-158621f77a21"
], - "invoiceIds": [
- "4f6cf35x-2c4y-483z-a0a9-158621f77a21"
], - "subscriptionIds": [
- "4f6cf35x-2c4y-483z-a0a9-158621f77a21"
], - "planIds": [
- "4f6cf35x-2c4y-483z-a0a9-158621f77a21"
], - "isRebill": true,
- "rebillNumber": 0,
- "billingAddress": {
- "firstName": "Benjamin",
- "lastName": "Franklin",
- "organization": "Rebilly",
- "address": "36 Craven St",
- "address2": "string",
- "city": "Austin",
- "region": "Texas",
- "country": "GB",
- "postalCode": "WC2N 5NF",
- "phoneNumbers": [
- {
- "label": "main",
- "value": "512-710-1640",
- "primary": true
}
], - "emails": [
- {
- "label": "main",
- "value": "rebilly@example.com",
- "primary": true
}
], - "dob": "1980-04-01",
- "jobTitle": "CEO",
- "hash": "056ae6d97c788b9e98b049ebafd7b229bf852221"
}, - "has3ds": true,
- "3ds": {
- "server": "string",
- "version": "1.0.2",
- "enrolled": "yes",
- "authenticated": "yes",
- "liability": "protected",
- "flow": "frictionless",
- "isDowngraded": false
}, - "retryNumber": 0,
- "isRetry": true,
- "billingDescriptor": "string",
- "description": "string",
- "requestId": "string",
- "hasAmountAdjustment": true,
- "gatewayName": "A1Gateway",
- "customFields": {
- "foo": "bar"
}, - "processedTime": "2019-08-24T14:15:22Z",
- "createdTime": "2019-08-24T14:15:22Z",
- "updatedTime": "2019-08-24T14:15:22Z",
- "paymentInstrument": {
- "method": "payment-card",
- "paymentInstrumentId": "4f6cf35x-2c4y-483z-a0a9-158621f77a21"
}, - "token": "string",
- "_links": [
- {
- "href": "string",
- "rel": "self"
}
]
}, - "token": "string"
}